
import React, { memo, useEffect, useState } from 'react';
import sty from './sty.module.css';
import SingerCover from '../hotArtits/child/artist/singerCover';
import ArtistHeaderLine from '../hotArtits/child/artist/headerLine';
import { reqSettleSinger } from '@/api/recommend';
import { message } from 'antd';

const Singer = () => {
  const [singer, setSinger] = useState([]);
  useEffect(() => {
    reqSettleSinger(6).then(res => {
      if (res.code === 200) {
        setSinger(res.artists)
      }
    }).catch(() => {
      message.error('请求异常，重试')
    })
  }, [])
  return <div className={sty.root}>
    <ArtistHeaderLine titleSlot='入住歌手' rightSlot='查看更多>' />
    <div className={sty.container}>
      {
        singer.length ? singer.map((v) => <SingerCover key={v.id} info={v} />) : ""
      }
    </div>
  </div>
}
export default memo(Singer)